

/*public class text17{
    public static void seletsort2(int[]arr)
    {
        int left=0;
        int right=arr.length-1;
        while(left<right)
        {
            int min=left;
            int max=left;
            int i=0;
            for(i=left+1;i<=right;i++)
            {
                if(arr[i]<arr[min])
                {
                    min=i;

                }
                if(arr[i]>arr[max])
                {
                    max=i;
                }
            }
            swap(arr,min,left);
            if(max==left)
            {
                max=min;
            }
            swap(arr,max,right);
            //swap(arr,min,left);
            //arr[left]=arr[min];
            //arr[right]=arr[max];
            left++;
            right--;
        }
    }
    public static void qiuklysort(int[]arr,int left,int right)
    {
        if(left>=right)
        {
            return;
        }
        int pre=find1(arr,left,right);
        qiuklysort(arr,left,pre-1);
        qiuklysort(arr,pre+1,right);


    }

    public static void quklysort4(int[]arr,int left,int right)
    {
        if(left>=right)
        {
            return;
        }
        if(right-left>=2)
        {
            selectsort3(arr,left,right);
        }
        int pre=find1(arr,left,right);
        qiuklysort(arr,left,pre-1);
        qiuklysort(arr,pre+1,right);
    }


    public static void insert(int[]arr,int left,int right)
    {
        int i=0;
        for(i=left+1;i<=right;i++)
        {
            int j=i-1;
            int tmp=arr[i];
            while(j>=0)
            {
                if(arr[i]<arr[j])
                {
                    arr[j+1]=arr[j];
                    j--;
                }
                else
                {
                    arr[j+1]=tmp;
                }
            }
            arr[0]=tmp;
        }
    }
    public static void qukly4(int[]arr) {
        int left = 0;
        int right = arr.length - 1;
        quklysort4(arr,left,right);


    }



    public static void quklysort2(int[]arr,int left,int right)
    {
        if(left>=right)
        {
            return;
        }

       int b= findmid(arr,left,right);
        //int tmp=arr[b];
        //arr[b]=arr[left];
        //arr[left]=tmp;
        int pre=find1(arr,left,right);
        quklysort2(arr,left,pre-1);
        quklysort2(arr,pre+1,right);


    }
    public static int findmid(int[]arr,int left,int right)
    {
        int mid=(left+right)/2;
        if(arr[left]>arr[right])
        {
            if(arr[mid]<arr[left])
            {
                return right;
            }
            else if(arr[mid]>arr[left])
            {
                return left;
            }
            else
            {
                return mid;
            }
        }
        else
        {
            if(arr[mid]<arr[left])
            {
                return left;
            }
            if(arr[mid]>arr[right])
            {
                return right;
            }
            return mid;
        }
    }
    public static void qukly(int[]arr)
    {
        int left=0;
        int right=arr.length-1;
        quklysort2(arr,left,right);
    }
    public static int find1(int[]arr,int left,int right)
    {
        int tmp=arr[left];
        while(left<right)
        {
            while(left<right&&arr[right]>=tmp)
            {
                right--;
            }
            arr[left]=arr[right];
            //left++;
            while(left<right&&arr[left]<=tmp)
            {
                left++;
            }
            arr[right]=arr[left];
            //right--;

        }
        arr[left]=tmp;
        return left;
    }
    public static void qiukly(int[]arr)
    {
        int left=0;
        int right=arr.length-1;
        //qiuklysort(arr,left,right);


    }
    public static int find(int[]arr,int left,int right)
    {
        int i=left;
        int pre=arr[left];
        while(left<right)
        {
            while(left<right&&arr[right]>=pre)
            {
                right--;
            }
            while(left<right&&arr[left]<=pre)
            {
                left++;
            }
            swap(arr,left,right);

            //left++;
            //right--;



        }
        swap(arr,left,i);
        return right;

    }
    public static void swap(int[]arr,int left,int right)
    {
       int tmp=arr[left];
       arr[left]=arr[right];
       arr[right]=tmp;

    }
    public static void maopao(int[]arr)
    {
       int i=0;
       for(i=0;i<arr.length-1;i++)
       {
           int j=0;
           boolean a=false;
           for(j=0;j<arr.length-1-i;j++)
           {
               if(arr[j]>arr[j+1])
               {
                   swop(arr,j);
                   a=true;
               }
           }
           if(a==false)
           {
               return;
           }
       }
    }
    public static void swop(int[]arr,int j)
    {
        int tmp=arr[j];
        arr[j]=arr[j+1];
        arr[j+1]=tmp;
    }
    public static void seletSort(int[] arr) {
        int i = 0;
        for (i = 0; i < arr.length; i++) {


            //int j = i + 1;
            int min = i;
            for(int j=i+1;j<arr.length;j++) {
                if(arr[j]<arr[min])
                {
                    min=j;
                }



            }


            if (min != i) {
                int tmp = arr[min];
                arr[min] = arr[i];
                arr[i] = tmp;
            }

        }
    }
    public static void main(String[] args) {


        int[]arr={9,2,5,1,7};
        int[]arr1={5,6,3,7,1};
       //seletSort(arr);
        //System.out.println(1);
        //maopao(arr);
        //System.out.println(1);
        //qiukly(arr1);
        qukly(arr1);
        //qukly3(arr1);
        System.out.println(1);



    }
}

 */


